import { Injectable } from '@angular/core';


@Injectable()
export class HideElementService {

  private menus = [];

  constructor(){
  }

  hideElement(obj){
    if(this.menus) {
      this.menus = JSON.parse(localStorage.getItem('menus'));
    }

    if(this.menus){
      for(let i in obj){
        obj[i] = this.menus.indexOf(obj[i]) >= 0 ? '' : 'none';
      }
    }

    return obj;
  }

}
